﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class ProjectGroupFacade
    {
        private IProjectGroupDAO projectGroupDAO = DAOAccess.ProjectGroupDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddProjectGroup(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.InsertProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddProjectGroupAndReturnIdentity(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.InsertProjectGroupReturnIdentity(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddProjectGroupAndReturnOutput(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.InsertProjectGroupReturnOutput(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteProjectGroup(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.DeleteProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectGroup> GetProjectGroup(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.GetProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectGroup> GetProjectGroup(string projectGroupId)
        {
            ProjectGroup clsProjectGroup = new ProjectGroup();
            clsProjectGroup.ProjectGroupId = projectGroupId;
            return this.projectGroupDAO.GetProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectGroup> GetsProjectGroup()
        {
            return this.projectGroupDAO.GetsProjectGroup();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsProjectGroup(string SPName, DbParameter[] param)
        {
            return this.projectGroupDAO.GetsProjectGroup(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectGroup> ListProjectGroup(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.ListProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectGroup> ListProjectGroup(string projectGroupId)
        {
            ProjectGroup clsProjectGroup = new ProjectGroup();
            clsProjectGroup.ProjectGroupId = projectGroupId;
            return this.projectGroupDAO.ListProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateProjectGroup(ProjectGroup clsProjectGroup)
        {
            return this.projectGroupDAO.UpdateProjectGroup(clsProjectGroup);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateProjectGroup(string SPName, DbParameter[] param)
        {
            return this.projectGroupDAO.UpdateProjectGroup(SPName, param);
        }
    }
}

